package demo.xlj.yuyi.studentapp;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ImageView;

import demo.xlj.yuyi.studentapp.utils.ActivityUtil;
import top.wefor.circularanim.CircularAnim;


public class TestActivity extends AppCompatActivity {

    private boolean isshow = false;

    private boolean isIsshow = true;

    private ImageView mImageView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_test);
        mImageView = (ImageView) findViewById(R.id.myImageView);
//        addRxDestroy(RetrofitClient.getInstance(getContext())
//                .getApiService()
//                .test()
//                .compose(RxSchedulers.<BemA>io_main())
//                .subscribe(new Consumer<BemA>() {
//                    @Override
//                    public void accept(@NonNull BemA bemA) throws Exception {
//                        Log.d("xxxx","获取了数据"+bemA.toString());
//                    }
//                }));
    }

    public void btn_shou_suo(View view) {
        if (isshow){
            CircularAnim.show(view).go();
        }else {
            CircularAnim.hide(view).go();
        }
        isshow = !isIsshow;
    }

    public void btn_show(View view) {
        if (isIsshow){
            CircularAnim.hide(mImageView).triggerView(view).go();
        }else {
            CircularAnim.show(mImageView).triggerView(view).go();
        }
        isIsshow = !isIsshow;
    }

    @Override
    public void onBackPressed() {
        super.onBackPressed();
        setResult(99);
        ActivityUtil.closeActivityRightToLeft(TestActivity.this);
    }
}
